package com.zhuhjay.eduservice.controller.front;

import com.zhuhjay.commonutils.R;
import com.zhuhjay.eduservice.service.EduCourseService;
import com.zhuhjay.eduservice.service.EduTeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ZhuHJay
 * @date 2022/9/7 22:53
 */
@Api(description = "前端控制器")
@RestController
@RequestMapping("/eduservice/indexfront")

public class IndexFrontController {

    @Resource
    private EduTeacherService teacherService;

    @Resource
    private EduCourseService courseService;

    @ApiOperation(value = "查询前8热门课程，前4名师")
    @GetMapping("index")
    public R index() {
        return R.ok().data("eduList", courseService.getCourseLimitList())
                .data("teacherList", teacherService.getTeacherLimitList());
    }

}
